package com.example.gitresp.controller;


import com.example.gitresp.pojo.Emp;
import com.example.gitresp.pojo.Result;
import com.example.gitresp.service.imp.EmpServiceImp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
//@RequestMapping("/empmine")
public class EmpController {
    @Autowired
    private EmpServiceImp empServiceImp;
    @RequestMapping("/empmine")
    public Result selectAll(){
        List<Emp> result = empServiceImp.selectAll();
        return Result.success(result);
    }
    @RequestMapping("/selectby/{id}")
    public Result selectBYId(@PathVariable Integer id){
        Emp emp = empServiceImp.selectBYId(id);
        return  Result.success(emp);
    }

//    @RequestMapping("/selectby/{staticword}")
//    public Result selectByStaticWord(String staticWord){
//
//    }

}